﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="WXUserList.aspx.cs" Inherits="WXUserList" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>微信名单</title>
    <script src="../js/extTools.js" type="text/javascript"></script>
    <style>
        .x-grid-row-over .x-grid-cell-inner
        {
            font-weight: bold;
        }
        .x-column-header-inner
        {
            height: 28px;
            background: #E7EBEF url(./images/header.png) repeat-x 0 0;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <ext:ResourceManager ID="ResourceManager1" runat="server" Theme="Crisp" />
        <ext:Viewport ID="Viewport1" runat="server" Layout="FitLayout">
            <Items>
                <ext:Hidden ID="FormatType" runat="server" />
                <ext:GridPanel ID="GridPanel1" runat="server" TitleAlign="Center">
                    <TopBar>
                        <ext:Toolbar ID="Toolbar1" runat="server">
                            <Items>
                                <ext:DateField runat="server" ID="txtbdate" FieldLabel="开始日期" />
                                <ext:DateField runat="server" ID="txtedate" FieldLabel="结束日期" />
                                <ext:Button ID="Button1" runat="server" Text="查询" OnDirectClick="BtnQureyUser" UI="Info">
                                    <DirectEvents>
                                        <Click Timeout="90000">
                                            <EventMask ShowMask="true" Msg="加载中...">
                                            </EventMask>
                                        </Click>
                                    </DirectEvents>
                                </ext:Button>
                                <ext:Button ID="Button3" runat="server" Text="获取微信名称" OnDirectClick="BtnWeiXinUser"
                                    UI="Primary">
                                    <DirectEvents>
                                        <Click Timeout="300000">
                                            <EventMask ShowMask="true" Msg="加载中...">
                                            </EventMask>
                                        </Click>
                                    </DirectEvents>
                                </ext:Button>
                            </Items>
                        </ext:Toolbar>
                    </TopBar>
                    <Store>
                        <ext:Store ID="Store1" runat="server" PageSize="1000" OnReadData="RefreshDataSet"
                            OnSubmitData="Store1_Submit">
                            <Model>
                                <ext:Model ID="Model1" runat="server" IDProperty="openid">
                                    <Fields>
                                        <ext:ModelField Name="openid" Mapping="openid" />
                                        <ext:ModelField Name="weixinName" Mapping="微信" />
                                        <ext:ModelField Name="sexname" Mapping="性別" />
                                        <ext:ModelField Name="imgurl" Mapping="图片" />
                                        <ext:ModelField Name="city" Mapping="城市" />
                                        <ext:ModelField Name="province" Mapping="省份" />
                                        <ext:ModelField Name="country" Mapping="国家" />
                                        <ext:ModelField Name="CreateDate" Mapping="时间" />
                                    </Fields>
                                </ext:Model>
                            </Model>
                        </ext:Store>
                    </Store>
                    <ColumnModel>
                        <Items>
                            <ext:Column ID="Column1" runat="server" Text="OPENID" DataIndex="openid" Width="300" />
                            <ext:Column ID="Column2" runat="server" Text="微信" DataIndex="weixinName" Width="200" />
                            <ext:Column ID="Column3" runat="server" Text="性別" DataIndex="sexname" Width="60" />
                            <ext:TemplateColumn ID="TemplateColumn1" runat="server" Text="图片" DataIndex="imgurl"
                                TemplateString='<img src={imgurl} style="width:60px;height:60px;"/>' />
                            <ext:Column ID="Column4" runat="server" Text="城市" DataIndex="city" Width="80" />
                            <ext:Column ID="Column5" runat="server" Text="省份" DataIndex="province" Width="80" />
                            <ext:Column ID="Column6" runat="server" Text="国家" DataIndex="country" Width="60" />
                            <ext:Column ID="Column8" runat="server" Text="时间" DataIndex="CreateDate" Width="180" />
                        </Items>
                    </ColumnModel>
                    <SelectionModel>
                        <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" />
                    </SelectionModel>
                    <BottomBar>
                        <ext:PagingToolbar ID="PagingToolbar1" runat="server">
                            <Items>
                                <ext:Label ID="Label1" runat="server" Text="每页显示:" />
                                <ext:ToolbarSpacer ID="ToolbarSpacer1" runat="server" Width="10" />
                                <ext:ComboBox ID="ComboBox1" runat="server" Width="80">
                                    <Items>
                                        <ext:ListItem Text="1000" />
                                        <ext:ListItem Text="2000" />
                                    </Items>
                                    <SelectedItems>
                                        <ext:ListItem Value="1000" />
                                    </SelectedItems>
                                    <Listeners>
                                        <Select Handler="#{GridPanel1}.store.pageSize = parseInt(this.getValue(), 10); #{GridPanel1}.store.reload();" />
                                    </Listeners>
                                </ext:ComboBox>
                                <ext:Button ID="Button2" runat="server" Text="导出Excel" Icon="PageExcel">
                                    <Listeners>
                                        <Click Handler="exportData('xls');" />
                                    </Listeners>
                                </ext:Button>
                            </Items>
                            <Plugins>
                                <ext:ProgressBarPager ID="ProgressBarPager1" runat="server" />
                            </Plugins>
                        </ext:PagingToolbar>
                    </BottomBar>
                </ext:GridPanel>
            </Items>
        </ext:Viewport>
    </div>
    </form>
</body>
</html>
